Python Data Visualization Essentials Guide by Kalilur Rahman

Python Data Visualization Essentials Guide by Kalilur Rahman

Author:Kalilur Rahman [Rahman, Kalilur]
Language: eng
Format: epub
ISBN: 9789391030063
Publisher: BPB Publications
Published: 2021-08-15T00:00:00+00:00


ax2 = titanic['Fare'][titanic['Sex']=='male'].hist(bins=25, label='Male')

titanic['Fare'][titanic['Sex']=='female'].hist(bins=25, ax = ax2, label='Female')

ax2.set_xlabel('Fare')

ax2.set_ylabel('Count')

ax2.set_title('Distribution by Fare')

ax2.legend()

plt.show()

We get the following output for the exercises 5-50 and 5-51 in Jupyter Notebook:

Figure 5.48: Pandas – histogram of two parameters – fare and gender of passengers in Titanic

Figure 5.49: Pandas – histogram of two parameters – age and gender of passengers in Titanic



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.